import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex); //vue的插件机制

const store = new Vuex.Store({
  state: {
    SigInList: '',
    // 会议
    meeting: {
      // 会议内容
      content: "",
      // 会议时间
      date: "",
      // 会议迟到人员
      latePerson: "",
      // 会议请假人员
      leavingPerson: "",
      // 会议主持人
      meetingHost: "",
      // 会议地点
      place: "",
      // 会议记录者
      recorder: "",
      // 哪个学期
      term: "",
      // 学期的第几周
      week: ""
    }
  },
  mutations: {
    changeContent(state, newData) {
      state.meeting.content = newData
    },
    changeDate(state, newDate) {
      state.meeting.date = newDate
    },
    changeLatePerson(state, newPerson) {
      state.meeting.latePerson = newPerson
    },
    changeLeavingPerson(state, newLeaving) {
      state.meeting.leavingPerson = newLeaving
    },
    changeHost(state, newHost) {
      state.meeting.meetingHost = newHost
    },
    changePlace(state, newPlace) {
      state.meeting.place = newPlace
    },
    changeRecorder(state, newRecorder) {
      state.meeting.recorder = newRecorder
    },
    changeTerm(state, newTerm) {
      state.meeting.term = newTerm
    },
    changeWeek(state, newWeek) {
      state.meeting.week = newWeek
    }
  }
})
export default store
